package com.vgemv.jsutilitysdk.activity.jsloglistactivity;

import com.vgemv.jsutilitysdk.file.JsFileManager;

import java.io.File;

public class JsLogFileItemModel {

    public File mFile;

    public String filePath;

    JsLogFileItemModel(String filePath) {
        this.filePath = filePath;
    }

    JsLogFileItemModel(File file){
        mFile = file;
        this.filePath = mFile.getAbsolutePath();
    }

    public String getFileName() {
        if(mFile == null) {
            mFile = new File(this.filePath);
        }
        return mFile.getName();
    }

    public String getFileContext() {
        return JsFileManager.readFileContentRapidly(mFile);
    }

}
